﻿<!--
 THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
 ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
 THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
 PARTICULAR PURPOSE.

 Copyright (c) Microsoft Corporation. All rights reserved
-->
<local:HiloPage
    x:Name="pageRoot"
    x:Uid="Page"
    x:Class="Hilo.CartoonizeImageView"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="using:Hilo"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d"
    DataContext="{Binding Source={StaticResource ViewModelLocator}, Path=CartoonizeImageVM}">
    
    <Grid x:Name="ContentRoot" 
          d:DataContext="{Binding Source={d:DesignInstance Type=local:DesignTimeData, IsDesignTimeCreatable=True}}"
          Background="{StaticResource HiloPageBackgroundBrush}">
        
        <!-- Cartoonize Image -->
        <Grid x:Name="CartoonizeImageGrid"
              Margin="50,50,50,110">
            <Grid.RowDefinitions>
                <RowDefinition Height="*" />
                <RowDefinition Height="100" />
            </Grid.RowDefinitions>
            <TextBlock x:Name="PageTitle"
                       x:Uid="CartoonizeImagePageTitle"
                       Style="{StaticResource SnappedPageHeaderTextStyle}"
                       VerticalAlignment="Top"
                       Visibility="Collapsed"/>
            <Image x:Name="Photo"
                   AutomationProperties.AutomationId="ImageControl"
                   HorizontalAlignment="Center"
                   Source="{Binding Image}"
                   VerticalAlignment="Center" />
            <ProgressRing IsActive="{Binding InProgress}"
                          Foreground="{StaticResource HiloHighlightBrush}"
                          Height="60"
                          Width="60" />
            <StackPanel x:Name="SlidersStackPanel"
                        Grid.Row="1"
                        HorizontalAlignment="Center"
                        Orientation="Horizontal">
                <StackPanel>
                    <Slider Minimum="2"
                            Maximum="6" 
                            SmallChange="1"
                            Style="{StaticResource HiloSliderStyle}"
                            Value="{Binding Path=NeighborWindow, Mode=TwoWay}"
                            Width="300" />
                    <TextBlock x:Uid="CartoonizeImagePageCoarsenessText"
                               HorizontalAlignment="Center"
                               Style="{StaticResource SubheaderTextStyle}"
                               Text="{Binding Coarseness}"/>
                </StackPanel>
                <StackPanel Margin="50,0,0,0">
                    <Slider Minimum="2"
                            Maximum="6"
                            SmallChange="1"
                            Style="{StaticResource HiloSliderStyle}"
                            Value="{Binding Path=Phases, Mode=TwoWay}"
                            Width="300"/>
                    <TextBlock x:Uid="CartoonizeImagePagePassesText"
                               HorizontalAlignment="Center"
                               Style="{StaticResource SubheaderTextStyle}"
                               Text="{Binding Passes}"/>
                </StackPanel>
            </StackPanel>
        </Grid>

        <VisualStateManager.VisualStateGroups>
            <VisualStateGroup x:Name="ApplicationViewStates">
                <VisualState x:Name="FullScreenLandscape"/>
                <VisualState x:Name="Filled"/>
                <VisualState x:Name="FullScreenPortrait">
                    <Storyboard>
                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="CartoonizeButton"
                                                       Storyboard.TargetProperty="Visibility">
                            <DiscreteObjectKeyFrame KeyTime="0"
                                                    Value="Collapsed"/>
                        </ObjectAnimationUsingKeyFrames>
                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="CartoonizeButtonNoLabel"
                                                       Storyboard.TargetProperty="Visibility">
                            <DiscreteObjectKeyFrame KeyTime="0"
                                                    Value="Visible"/>
                        </ObjectAnimationUsingKeyFrames>
                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="CancelButton"
                                                       Storyboard.TargetProperty="Visibility">
                            <DiscreteObjectKeyFrame KeyTime="0"
                                                    Value="Collapsed"/>
                        </ObjectAnimationUsingKeyFrames>
                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="CancelButtonNoLabel"
                                                       Storyboard.TargetProperty="Visibility">
                            <DiscreteObjectKeyFrame KeyTime="0"
                                                    Value="Visible"/>
                        </ObjectAnimationUsingKeyFrames>
                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="SaveButton"
                                                       Storyboard.TargetProperty="Visibility">
                            <DiscreteObjectKeyFrame KeyTime="0"
                                                    Value="Collapsed"/>
                        </ObjectAnimationUsingKeyFrames>
                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="SaveButtonNoLabel"
                                                       Storyboard.TargetProperty="Visibility">
                            <DiscreteObjectKeyFrame KeyTime="0"
                                                    Value="Visible"/>
                        </ObjectAnimationUsingKeyFrames>
                    </Storyboard>
                </VisualState>
                <VisualState x:Name="Snapped">
                    <Storyboard>
                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="CartoonizeButton"
                                                       Storyboard.TargetProperty="Visibility">
                            <DiscreteObjectKeyFrame KeyTime="0"
                                                    Value="Collapsed"/>
                        </ObjectAnimationUsingKeyFrames>
                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ResumeCartoonizeButton"
                                                       Storyboard.TargetProperty="Visibility">
                            <DiscreteObjectKeyFrame KeyTime="0"
                                                    Value="Visible"/>
                        </ObjectAnimationUsingKeyFrames>
                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="CancelButton"
                                                       Storyboard.TargetProperty="Visibility">
                            <DiscreteObjectKeyFrame KeyTime="0"
                                                    Value="Collapsed"/>
                        </ObjectAnimationUsingKeyFrames>
                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="CancelButtonNoLabel"
                                                       Storyboard.TargetProperty="Visibility">
                            <DiscreteObjectKeyFrame KeyTime="0"
                                                    Value="Visible"/>
                        </ObjectAnimationUsingKeyFrames>
                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="SaveButton"
                                                       Storyboard.TargetProperty="Visibility">
                            <DiscreteObjectKeyFrame KeyTime="0"
                                                    Value="Collapsed"/>
                        </ObjectAnimationUsingKeyFrames>
                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="PageTitle"
                                                       Storyboard.TargetProperty="Visibility">
                            <DiscreteObjectKeyFrame KeyTime="0"
                                                    Value="Visible" />
                        </ObjectAnimationUsingKeyFrames>
                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="SlidersStackPanel"
                                                       Storyboard.TargetProperty="Visibility">
                            <DiscreteObjectKeyFrame KeyTime="0"
                                                    Value="Collapsed"/>
                        </ObjectAnimationUsingKeyFrames>
                    </Storyboard>
                </VisualState>          
            </VisualStateGroup>
        </VisualStateManager.VisualStateGroups>    
    </Grid>
    
    <local:HiloPage.BottomAppBar>
        <AppBar x:Name="CartoonizeImageBottomAppBar"
                x:Uid="AppBar"
                AutomationProperties.AutomationId="CartoonizeImageBottomAppBar"
                IsOpen="True"
                IsSticky="{Binding IsAppBarSticky}"
                Padding="10,0,10,0">
            <Grid>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="*" />
                    <ColumnDefinition Width="*" />
                </Grid.ColumnDefinitions>
                <StackPanel HorizontalAlignment="Left"
                            Orientation="Horizontal">
                    <Button x:Name="CartoonizeButton"
                            x:Uid="PreviewAppBarButton"
                            Command="{Binding CartoonizeCommand}"
                            Style="{StaticResource CartoonEffectAppBarButtonStyle}"
                            Tag="Preview" />
                    <Button x:Name="ResumeCartoonizeButton"
                            Command="{Binding ResumeCartoonizeCommand}"
                            Style="{StaticResource CartoonEffectAppBarButtonNoLabelStyle}"
                            Tag="Resume cartoon effect"
                            Visibility="Collapsed">
                        <ToolTipService.ToolTip>
                            <ToolTip x:Uid="ResumeCartoonizeAppBarButtonToolTip" />
                        </ToolTipService.ToolTip>
                    </Button>
                    <Button x:Name="CartoonizeButtonNoLabel"
                            Command="{Binding CartoonizeCommand}"
                            Style="{StaticResource CartoonEffectAppBarButtonNoLabelStyle}"
                            Tag="Cartoon effect"
                            Visibility="Collapsed">
                        <ToolTipService.ToolTip>
                            <ToolTip x:Uid="PreviewCartoonizeAppBarButtonToolTip" />
                        </ToolTipService.ToolTip>
                    </Button>
                </StackPanel>
                <StackPanel Grid.Column="1"
                            HorizontalAlignment="Right"
                            Orientation="Horizontal">
                    <Button x:Name="CancelButton"
                            x:Uid="CancelAppBarButton"
                            Command="{Binding CancelCommand}" 
                            Style="{StaticResource CancelAppBarButtonStyle}" 
                            Tag="Cancel" />
                    <Button x:Name="CancelButtonNoLabel"
                            Command="{Binding CancelCommand}"
                            Style="{StaticResource CancelAppBarButtonNoLabelStyle}"
                            Visibility="Collapsed">
                        <ToolTipService.ToolTip>
                            <ToolTip x:Uid="CancelCartoonizeAppBarButtonToolTip" />
                        </ToolTipService.ToolTip>
                    </Button>
                    <Button x:Name="SaveButton"
                            x:Uid="AcceptAppBarButton"
                            Command="{Binding SaveCommand}" 
                            Style="{StaticResource AcceptAppBarButtonStyle}"
                            Tag="Save" />
                    <Button x:Name="SaveButtonNoLabel"
                            Command="{Binding SaveCommand}"
                            Style="{StaticResource AcceptAppBarButtonNoLabelStyle}"
                            Tag="Save"
                            Visibility="Collapsed">
                        <ToolTipService.ToolTip>
                            <ToolTip x:Uid="AcceptCartoonizeAppBarButtonToolTip" />
                        </ToolTipService.ToolTip>
                    </Button>
                </StackPanel>
            </Grid>
        </AppBar>
    </local:HiloPage.BottomAppBar>
</local:HiloPage>

